package com.example.demo.dao.permission;

import com.example.demo.entity.permission.TPermission;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.Set;


public interface TPermissionMapper extends BaseMapper<TPermission> {

    @Select("select p.permissionname from t_user  u LEFT JOIN t_user_role  ur on  u.id = ur.user_id LEFT JOIN t_permission p on ur.role_id = p.role_id where u.username = #{username}")
    Set<String> getPermissionsByUserName(String username);
}
